
package de.justphil.tcg.tcgandroidclient.gui.decks;

import java.util.List;

import de.justphil.tcg.tcgandroidclient.content.TCGContentAdapter;
import de.justphil.tcg.tcgandroidclient.content.view.ViewDeck;
import android.database.ContentObserver;
import android.os.Handler;
import android.os.Looper;
import android.widget.ArrayAdapter;

//public class DeckListUpdater extends ContentObserver {
//	
//	private final TCGContentAdapter contentAdapter;
//	private final long userId;
//	private final ArrayAdapter<ViewDeck> adapter;
//	
//	public DeckListUpdater(Looper looper, TCGContentAdapter contentAdapter, long userId,
//			ArrayAdapter<ViewDeck> adapter) {
//	
//		super(new Handler(looper));
//		this.contentAdapter = contentAdapter;
//		this.userId = userId;
//		this.adapter = adapter;
//	}
//	
//	
//	@Override
//	public void onChange(boolean selfChange) {
//	
//		super.onChange(selfChange);
//		List<ViewDeck> decks = contentAdapter.readDecks(userId, null);
//		adapter.setNotifyOnChange(false);
//		adapter.clear();
//		for (int i = 0; i < decks.size(); i++) {
//			adapter.add(decks.get(i));
//		}
//		adapter.notifyDataSetChanged();
//		adapter.setNotifyOnChange(true);
//	}
//}
